<?php
function getAFLTeam($teamCode) {
	$teamName = "";
	if ($teamCode == 'HAWTHORN') $teamName = "Hawthorn";
	else if ($teamCode == 'CARLTON') $teamName = "Carlton";
	else if ($teamCode == 'MELBOURNE') $teamName = "Melbourne";
	else if ($teamCode == 'FREMANTLE') $teamName = "Fremantle";
	else if ($teamCode == 'WCE') $teamName = "West Coast";
	else if ($teamCode == 'ESSENDON') $teamName = "Essendon";
	else if ($teamCode == 'COLLINGWOOD') $teamName = "Collingwood";
	else if ($teamCode == 'ADELAIDE') $teamName = "Adelaide";
	else if ($teamCode == 'PORT_ADELAIDE') $teamName = "Port Adelaide";
	else if ($teamCode == 'WESTERN_BULLDOGS') $teamName = "Western Bulldogs";
	else if ($teamCode == 'ST_KILDA') $teamName = "St Kilda";
	else if ($teamCode == 'SYDNEY') $teamName = "Sydney";
	else if ($teamCode == 'BRISBANE') $teamName = "Brisbane";
	else if ($teamCode == 'GEELONG') $teamName = "Geelong";
	else if ($teamCode == 'NORTH_MELBOURNE') $teamName = "North Melbourne";
	else if ($teamCode == 'RICHMOND') $teamName = "Richmond";
	else if ($teamCode == 'GC') $teamName = "Gold Coast";
	else if ($teamCode == 'GWS') $teamName = "Greater Western Sydney";
	else if ($teamCode == 'PSD') $teamName = "PSD Potentials";
	
	return $teamName;
}

function getAFLTeamMapKey($teamName) {
	$teamCode = "";
        if ($teamName == "Hawthorn" || $teamName == "HAW") $teamCode = 'HAWTHORN';
	else if ($teamName == "Carlton" || $teamName == "CAR") $teamCode = 'CARLTON';
	else if ($teamName == "Melbourne" || $teamName == "MEL") $teamCode = 'MELBOURNE';
	else if ($teamName == "Fremantle" || $teamName == "FRE") $teamCode = 'FREMANTLE';
	else if ($teamName == "West Coast" || $teamName == "WCE" || $teamName == "West Coast Eagles") $teamCode = 'WCE';
	else if ($teamName == "Essendon" || $teamName == "ESS") $teamCode = 'ESSENDON';
	else if ($teamName == "Collingwood" || $teamName == "COL") $teamCode = 'COLLINGWOOD';
	else if ($teamName == "Adelaide" || $teamName == "ADE") $teamCode = 'ADELAIDE';
	else if ($teamName == "Port Adelaide" || $teamName == "PTA") $teamCode = 'PORT_ADELAIDE';
	else if ($teamName == "Western Bulldogs" || $teamName == "WBD") $teamCode = 'WESTERN_BULLDOGS';
	else if ($teamName == "St Kilda" || $teamName == "STK") $teamCode = 'ST_KILDA';
	else if ($teamName == "Sydney" || $teamName == "Sydney Swans" || $teamName == "SYD") $teamCode = 'SYDNEY';
	else if ($teamName == "Brisbane" || $teamName == "BRL" || $teamName == "Brisbane Lions") $teamCode = 'BRISBANE';
	else if ($teamName == "Geelong" || $teamName == "GEE" || $teamName == "Geelong Cats") $teamCode = 'GEELONG';
	else if ($teamName == "North Melbourne" || $teamName == "NTH") $teamCode = 'NORTH_MELBOURNE';
	else if ($teamName == "Richmond" || $teamName == "RIC") $teamCode = 'RICHMOND';
	else if ($teamName == "Gold Coast" || $teamName == "GCS" || $teamName == "Gold Coast Suns") $teamCode = 'GC';
	else if ($teamName == "Greater Western Sydney" || $teamName == "GWS Giants" || $teamName == "GWS") $teamCode = 'GWS';
	else if ($teamName == "PSD Potentials") $teamCode = 'PSD';
	
	return $teamCode;
}

class TradeItemType {
	const Player = "PLAYER";
	const Pick = "PICK";
}

class PartyType {
	const PartyOne = "PARTY_ONE";
	const PartyTwo = "PARTY_TWO";
}

class TimeToPerformTaskType {
	const ScoreCheck = "SCORECHECK";
	const SendReminders = "SEND_REMINDERS";
	const UploadSelectedTeams = "UPLOAD_SELECTED_TEAMS";
}

class RoundStatusType {
	const Open = "OPEN";
	const Partial_Lockout = "PARTIAL_LOCKOUT";
	const Lockout = "LOCKOUT";
}

class TradeState {
	const Proposed = "PROPOSED";
	const Confirmed = "CONFIRMED";
	const Rejected = "REJECTED";
	const ConfirmedAndInformed = "CONFIRMED_INFORMED";
	const Invalid = "INVALID";
	const Countered = "COUNTERED";	
}

class Position {
	const LBP = "LBP";
	const FB = "FB";
	const RBP = "RBP";
	const LHBF = "LHBF";
	const CHB = "CHB";
	const RHBF = "RHBF";
	const LW = "LW";
	const C = "C";
	const RW = "RW";
	const LHFF = "LHFF";
	const CHF = "CHF";
	const RHFF = "RHFF";
	const LFP = "LFP";
	const FF = "FF";
	const RFP = "RFP";
	const R = "R";
	const F1 = "F1";
	const F2 = "F2";
	
	public function getAll() {
		return array("LBP", "FB", "RBP", "LHBF", "CHB", "RHBF", "LW", "C", "RW", "LHFF", "CHF", "RHFF", "LFP", "FF", "RFP", "R", "F1", "F2", "E1", "E2", "E3", "E4", "E5");
	}
}

class KPPStatusBoard {
	const GB = "goblues101";
	const scrote = "scrote";
	const JB = "JB0016";
	const Stoop = "Stooper";
	const mallia = "mallia";
	const Maso = "Maso";
	
	public function getAll() {
		return array("goblues101", "scrote", "JB0016", "Stooper", "mallia", "Maso");
	}
	
	public function isAuthentic($loggedInUser) {
		$allBoardMembers = KPPStatusBoard::getAll();
		$count = count($allBoardMembers);
		for ($i = 0; $i < $count; $i++) {
			if ($loggedInUser == $allBoardMembers[$i]) {
				return true;
			}
		}
		
		return false;
	}
}

class Admin {
	const Maso = "Maso";
	
	public function getAll() {
		return array("Maso");
	}
	
	public function isAuthentic($loggedInUser) {
		$allBoardMembers = Admin::getAll();
		$count = count($allBoardMembers);
		for ($i = 0; $i < $count; $i++) {
			if ($loggedInUser == $allBoardMembers[$i]) {
				return true;
			}
		}
		
		return false;
	}
}

class HyroAdmin {
	const Maso = "Maso";
	const Blighty = "Blighty";
	
	public function getAll() {
		return array("Maso", "Blighty");
	}
	
	public function isAuthentic($loggedInUser) {
		$allBoardMembers = HyroAdmin::getAll();
		$count = count($allBoardMembers);
		for ($i = 0; $i < $count; $i++) {
			if ($loggedInUser == $allBoardMembers[$i]) {
				return true;
			}
		}
		
		return false;
	}
}

class GamePlayer {
	const GB = "goblues101";
	const scrote = "scrote";
	const JB = "JB0016";
	const Stoop = "Stooper";
	const mallia = "mallia";
	const Maso = "Maso";
	const Xavier = "Xavier";
	const bluebagger97 = "bluebagger97";
	const AidansBlues = "Aidans Blues";
	const LittleBlueBoy2906 = "LittleBlueBoy2906";
	const Tigerboy = "Tigerboy";
	const Blues4flag = "Blues4flag";
	const RichoMan = "RichoMan";
	const TopGun = "Top Gun";
	const JoshsHeroes = "Joshs Heroes";
	const goodesy = "goodesy";
	
	public function getAll() {
		return array("goblues101", "scrote", "JB0016", "Stooper", "mallia", "Maso", "Xavier", "bluebagger97", "Aidans Blues", "LittleBlueBoy2906", "Tigerboy", "Blues4flag", "RichoMan", "DimaV", "Joshs Heroes", "goodesy");
	}
	
	public function isAuthentic($loggedInUser) {
		$allPlayers = GamePlayer::getAll();
		$count = count($allPlayers);
		for ($i = 0; $i < $count; $i++) {
			if ($loggedInUser == $allPlayers[$i]) {
				return true;
			}
		}
		
		return false;
	}
}

class HyroGamePlayer {
	const Maso = "Maso";
	const sblight = "sblight";
	const TapThat = "TapThat";
	const modder = "mhodder";
	const pcook = "pcook";
	const jkat = "jkat";
	const rhodder = "rhodder";
	const Stooper = "Stooper";
	const ltruefeldt = "ltruefeldt";
	const kyong = "kyong";
	const jgurfinkel = "jgurfinkel";
	const bbennett = "bbennett";
	
	public function getAll() {
		return array("Maso", "sblight", "TapThat", "mhodder", "pcook", "jkat", "rhodder", "Stooper", "ltruefeldt", "kyong", "jgurfinkel", "bbennett");
	}
	
	public function isAuthentic($loggedInUser) {
		$allPlayers = HyroGamePlayer::getAll();
		$count = count($allPlayers);
		for ($i = 0; $i < $count; $i++) {
			if ($loggedInUser == $allPlayers[$i]) {
				return true;
			}
		}
		
		return false;
	}
}

class AuthenticationType {
	const KPPStatusBoard = "KPPStatusBoard";
	const GamePlayer = "GamePlayer";  
	const HyroGamePlayer = "HyroGamePlayer";
}

class SettingType {
	const KPPStatusPerPage = "KPPSTATUS_PER_PAGE";
	const TradesPerPage = "TRADES_PER_PAGE";
	const UsePreferences = "USE_PREFERENCES";
	
	const ShowDraftTab = "SHOW_DRAFT_TAB";
	const ShowArchiveTab = "SHOW_ARCHIVE_TAB";
	const ShowPrefTab = "SHOW_PREF_TAB";
	const ShowReviewTab = "SHOW_REVIEW_TAB";
	const ShowOverviewTab = "SHOW_OVERVIEW_TAB";
	const Bot = "BOT";
}

class ReplacementType {
	const HSP = "Highest scoring player";
	const HSP_With_Playing_Ruck = "Highest scoring player, due to a playing Ruck or spare playing KPP/Ruck";
	const Ruck_Emergency = "Ruck emergency";
	const KPP_With_KPP_Ruck_Slide_In_Defence = "KPP Emergency, with KPP/Ruck slide to Ruck from defence(either KPD requirements still met or Emergency is KPD)";
	const KPP_With_KPP_Ruck_Slide = "KPP Emergency, with KPP/Ruck slide to Ruck";
	const KPP_Emergency = "KPP emergency";
	const Half_KPP_Emergency = "Half KPP emergency";
	const KPD_Emergency = "KPD emergency";
	const Half_KPD_Emergency = "Half KPD emergency";
	const Ruck_Emergency_With_KPP_Ruck_Slide_In_Defence = "Ruck Emergency, with KPP/Ruck slide to KPP in defence";
	const Ruck_Emergency_With_KPP_Ruck_Slide = "Ruck Emergency, with KPP/Ruck slide to KPP";
}

class PlayerType {
	const Ruck = "RUCK";
	const KPP = "KPP";
	const KPP_Ruck = "KPP_RUCK";
	const Half_KPP = "HALF_KPP";
}

class LtiState {
	const Open = "OPEN";
	const Returned = "RETURNED";
	const Closed = "CLOSED";
}

class TeamSubmittedStatus {
	const Submitted = "SUBMITTED";
	const Submitted_Informed = "SUBMITTED_INFORMED";	
	const Not_Submitted = "NOT_SUBMITTED";
}

class LtiSubmittedStatus {
	const Submitted = "SUBMITTED";
	const Submitted_Informed = "SUBMITTED_INFORMED";	
}

class TradeType {
	const Lti = "LTI";
	const Spud = "SPUD";
	const Suspended = "SUSPENDED";
	const Injury = "INJURY";
}

class DraftPickStatus {
	const Skipped = "SKIPPED";
	const Skipped_Informed = "SKIPPED_INFORMED";
	const Picked = "PICKED";
	const Picked_Informed = "PICKED_INFORMED";
	const Not_Picked = "NOT_PICKED";
}

class PreferenceStatus {
	const Taken = "TAKEN";
	const Not_Taken = "NOT_TAKEN";
	const Used = "USED";
}
?>